
<div role="main" class="container">


  <div class="page-header" style="margin-top:3em;">



    <div class="row-fluid">

      <div class="span13">



<div class="userdetailframe">
    <h2  >
   {{sessionplayer.firstname}} {{sessionplayer.lastname}}
  </h2>
  <span style="margin-top:2em;">
    <i style="font-family:Arial;font-size:16px;"><b>Email: {{sessionplayer.email}}</b>: <br>{{eventdescriptor.event.description}}</i>

  </span>

<br>
  <ul class="specsa">
    <li>
      Payment Account Email: {{ppevar}}  <button class="btn btn-default" ng-click="setPayPalEmail()">Modify payment options</button>
    </li>    
    <li>
      Account provider: Paypal
    </li>    
    <li>
      Use P2P Payments: {{sessionplayer.p2p}}  
    </li>  

<div ng-controller="ExplainUserStatusCtrl">
  <button class="btn btn-small" ng-click="isCollapsed = !isCollapsed" title="Click to show/hide">Explain payments</button>
  <div ng-show="isCollapsed">
    <div class="well well-lg">      
<h4>P2P Enabled: Paypal payments to other users</h4>
      P2P payments enabled: If Alice, Bob and Jim have all betted on a bet and only Alice has a winning bet, Bob and Jim will pay directly to Alice. Alice will see incoming transactions from Bob and Jim, and Bob and Jim will se outgoing transactions to Alice.
      <h4>P2P Disabled: Paypal payments to and from EddeVedde</h4>
      If disabled, the outcomes of course will be the same, but Bob and Jim will see EddeVedde as receiver of payments, and Alice will get payments from EddeVedde. No change in the numbers, but some players will prefer not to have to handle multiple receiving accounts.
    </div> 
  </div>
</div>

<div class="row">
  <hr/>
</div>
    <li ng-show="settledbets.length<5">


    <h3>Progress to green</h3>

<span title="You have green status when you have reached 5 settled bets">
<div class="row">
        <div class="col-sm-4"><div max="5" value="{{settledbets.length}}" type="danger" class="progress-striped active progress ng-isolate-scope">
  <div style="width: 83%;" class="progress-bar progress-bar-danger" ng-class="type &amp;&amp; 'progress-bar-' + type" role="progressbar" aria-valuenow="{{settledbets.length}}" aria-valuemin="0" aria-valuemax="5" ng-style="{width: percent + '%'}" aria-valuetext="83%" ><i class="ng-scope">{{settledbets.length}} / 5</i></div>
</div></div>
    
</div>

    </li>


<li>

<!--start player color-->
<div ng-controller="ExplainUserStatusCtrl">
<div ng-show="(!unpaidTransfers ||unpaidTransfers.length==0) && progressComplete()">  
  Your status is <button class="btn-success btn-large" title="Click for details" ng-click="isCollapsed = !isCollapsed">GREEN</button>
</div>
<div ng-show="unpaidTransfers.length==0 && !progressComplete()">
  Your status is <button class="btn-warning btn-large" title="Click for details" ng-click="isCollapsed = !isCollapsed">INITIAL</button>
</div>
<div ng-show="unpaidTransfers.length>0">
  Your status is <button class="btn-danger btn-large" title="Click for details" ng-click="isCollapsed = !isCollapsed">RED</button>
</div>

<hr>

  <div ng-show="isCollapsed">
    <div class="well well-lg">
      A player can have one of 3 statuses: <br> <h4>Initial</h4> This is the status you have when you first register. 
<h4>Green</h4>
      In order to get from initial to green status you need to 
    <ul>  
<li>Set Paypal email</li>
<li>Have completed at least 5 bets (does not matter if you win or lose)</li>
<li>Be debt-free</li>      
</ul>
<h4>Red</h4>
      If you have unpaid debt. New bets can not be placed if your status is red.
<br>


    </div> 
  </div>
</div>
<!--end player color-->

</li>
</ul>




<!--start events awaiting decision-->
<div ng-show="oe.length>0">

<h3>Events awaiting your decision is {{oe.length}}</h3>
  <button class="btn btn-small" ng-click="awaitingdecision = !awaitingdecision" title="Click to show/hide">Show/hide events to decide</button>

<div ng-show="awaitingdecision">

        <table tr-ng-grid="" items="oe" fields="['name','description']" enable-filtering="false" selection-mode="SingleRow">
    <tbody>
        <tr>
            <td>
                <button class="btn btn-default" ng-click="gotoEvent(gridItem.id);">
                    Decide
                </button>
            </td>
        </tr>
    </tbody>          
        </table>

</div>
</div>
  <!--end events awaiting decision-->

<!--Start unpaid debt-->
<div ng-show="unpaidTransfers.length>0">
  <p>
<h4>Number of outstanding transfers is {{unpaidTransfers.length}}</h4>
  

<div>
                
      Debt to pay: {{totaloutstanding}}
      <button class="btn btn-primary" ng-click="pay()">Pay</button>

    </div>
</div> 
<hr>

<!--End unpaid debt-->


<!--Start bet history-->

<hr>
<div ng-show="mybets.length>0">
  <h4>Number of bets is {{mybets.length}}</h4>
<button class="btn btn-default" ng-click="showbethistory = !showbethistory" title="Click to show/hide">Show/hide bet history</button>

<div ng-show="showbethistory">
<table tr-ng-grid="" items="mybets" fields="['event.name','option.name','amount','formattedTimeOfBet','event.state']" enable-filtering="false"></table>
</div>

</div>

<!--End bet history-->







</div>

<!--end userdetailwrapper-->



<!--modalform-->


<div>

   <script type="text/ng-template" id="ppecontent.html">

        <div class="modal-header">
            <h3 class="btn-primary">Set PayPal account email to use</h3>
        </div>
        <div class="modal-body">
<!--begynn-->
 <div>
                
                   <form name="ppeform" ng-submit="ok(ppeval)" method="POST">
      <div class="control-group">
        <label>Paypal email</label>
        <div class="controls">
                           <input type="text" popover="Email for PayPal payments/transfers" 
                popover-trigger="focus" ng-maxlength=20 better-placeholder ng-model="ppeval.email" 
                class="form-control better-placeholder" placeholder="Email for PayPal payments/transfers"/>
        </div>
      </div>

  
      <div class="control-group">
        <label>Use same as registered with EddeVedde: {{sessionplayer.email}}</label>
        <div class="controls">
          <input type="checkbox" class="form-control" ng-model="ppeval.usesame"/> 
        </div>
      </div>



      <div class="control-group">
        <label>P2P payment:</label>
        <div class="controls">
                           <input type="checkbox" class="form-control" ng-model="ppeval.p2p" ng-disabled="true"/> 
        </div>
      </div>

      <p class="submit">
        <input type="Submit" value="Confirm"/>
      </p>
                  <div ng-show="ppesuccess">
                <button class="btn btn-default" ng-click="close()">Close</button>
            </div>

</form>
</div>

        </div>

    </script>

      </div>
<!--endmodalform-->















    </div>

  </div>

</div>
